﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using PickGold.Handler;

namespace PickGold.Generic
{
	/// <summary>
	/// 通用接口
	/// </summary>
	/// <typeparam name="T">通用类型</typeparam>
	public interface ICommon<T>
	{
		/// <summary>
		/// 值
		/// </summary>
		T Value { set; get; }

		/// <summary>
		/// 值托管
		/// </summary>
		HByReturnDelegate<T, T> Handler { set; get; }
	}

	/// <summary>
	/// 通用接口
	/// </summary>
	public interface ICommon
	{
		/// <summary>
		/// 取指定类型值
		/// </summary>
		/// <typeparam name="T">指定的类型</typeparam>
		/// <param name="defaultValue">默认值</param>
		/// <returns>值列表中符合类型的值</returns>
		T GetValue<T>(T defaultValue);

		/// <summary>
		/// 取指定类型值委托
		/// </summary>
		/// <typeparam name="T">指定的类型</typeparam>
		/// <param name="defaultHandler">默认值</param>
		/// <returns>值列表中符合类型的值委托</returns>
		HByReturnDelegate<T, T> GetHandler<T>(HByReturnDelegate<T, T> defaultHandler);

		/// <summary>
		/// 取所有值类型
		/// </summary>
		/// <returns>所有值类型</returns>
		Type[] GetTypes();

		/// <summary>
		/// 取所有值委托
		/// </summary>
		/// <returns>所有值委托</returns>
		Delegate[] GetHandlers();

		/// <summary>
		/// 取所有值
		/// </summary>
		/// <returns>所有值</returns>
		object[] GetValues();
	}
}
